package kr.hkit.powerjava.chapter22.work4.dao;

import java.util.ArrayList;

import kr.hkit.powerjava.chapter22.work4.vo.Student;

public class StudentManagerImpl implements ItemDaoInterface<Student> {
	private ArrayList<Student>arList;
	
	public StudentManagerImpl(ArrayList<Student> arList) {
		this.arList = arList;
	}

	@Override
	public void addItem(Student item) {
		arList.add(item);
	}

	@Override
	public void delItem(Student item) {
		arList.remove(item);
	}

	@Override
	public void updateItem(Student item) {
		arList.set(arList.indexOf(item), item);
	}

	@Override
	public boolean serchItem(Student item) {
		
		return arList.contains(item);
	}

	@Override
	public void prnItems() {
		for (Student std: arList){
			System.out.println(std);
		}
	}

	
}
